/*
 * network.h
 *
 *
 *  Created on: 26/06/2011
 *      Author: Geoge Ferreira
 */

#ifndef NETWORK_H_
#define NETWORK_H_

#include <vector>
#include <exception>
#include <sys/types.h>

#include "node.h"

class DuplicatedNodeException: public std::exception{
	public:
	virtual const char *what(){
		return "Item duplicado";
	}
};


class Network {
public:
	std::vector <Node*> elements;

	unsigned nodes;
	Network();
	unsigned insert(Node *host);
	unsigned position(Node *host);
	unsigned heHash();
	Host *find(Node *host);
//private:
	unsigned hash(Node *host);
	bool empty(std::vector <Node*> &elements);
	bool free(std::vector <Node*> &elements);
};

#endif /* NETWORK_H_ */
